package com.gilight.base.controller;

import com.gilight.base.aspect.annotation.OperatorLog;
import com.gilight.base.base.ResultEntity;
import com.gilight.base.dto.SysUserAccessLogDto;
import com.gilight.base.dto.UserDto;
import com.gilight.base.model.SysUserAccessLog;
import com.gilight.base.service.ISysUserAccessLogService;
import com.github.pagehelper.PageInfo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/web/sysLog")
public class SysUserAccessLogController {
    @Resource
    private ISysUserAccessLogService logService;

    @RequestMapping(value = "/findList", method = {RequestMethod.POST, RequestMethod.GET})
    @OperatorLog(value ="登陆日志查询",operateType = "查询")
    public ResultEntity findList(@RequestBody @Validated SysUserAccessLogDto sysUserAccessLogDto) {
        ResultEntity resultEntity = new ResultEntity();
        PageInfo page = logService.findList(sysUserAccessLogDto);
        resultEntity.setData(page);
        return resultEntity;
    }
}
